home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Programming / RxMUI / Examples / showhide.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2001-05-24  |  2.9 KB  |  95 lines

  1. /* showhide.rexx 1.1 (11.11.2000) */
  2.  
  3. signal on halt
  4. signal on break_c
  5.  
  6. call init
  7. call CreateApp
  8. call HandleApp
  9. /* never reached */
  10. /***********************************************************************/
  11. init: procedure expose global.
  12.     l="rmh.library";if ~show("L",l) then;if ~AddLib(l,0,-30) then exit
  13.     if AddLibrary("rxmui.library")~=0 then exit
  14.     return
  15. /***********************************************************************/
  16. CreateApp: procedure expose global.
  17.  
  18.     app.title="ShowHide"
  19.     app.version="$VER: ShowHide 1.0 (20.7.2000)"
  20.     app.copyright="Copyright 2000 by Alfie"
  21.     app.author="alfie"
  22.     app.description="Show object hiding."
  23.     app.base="SHOWHIDE"
  24.     app.SubWindow="mwin"
  25.  
  26.      mwin.ID="MAIN"
  27.      mwin.title="Show & Hide"
  28.      mwin.contents="mgroup"
  29.  
  30.       call child("mgroup","g0","group")
  31.        g0.frame="group"
  32.  
  33.         call child("g0","g00","group")
  34.          g00.horiz=1
  35.          g00.weight=0
  36.           g00.0=hspace(0)
  37.           g00.1=CheckMark("c0",1)
  38.           g00.2=CheckMark("c1",1)
  39.           g00.3=CheckMark("c2",1)
  40.           g00.4=CheckMark("c3",1)
  41.           g00.5=CheckMark("c4",1)
  42.           g00.6=hspace(0)
  43.  
  44.         call child("g0","g01","group")
  45.           g01.0=button("b0","Button 1")
  46.           g01.1=button("b1","Button 2")
  47.           g01.2=button("b2","Button 3")
  48.           g01.3=button("b3","Button 4")
  49.           g01.4=button("b4","Button 5")
  50.           g01.5=VSpace(0)
  51.  
  52.     res=NewObj("application","app")
  53.     if res~=0 then call err(res)
  54.  
  55.     call notify("mwin","CloseRequest",1,"app","ReturnID","quit")
  56.     call notify("c0","selected","EveryTime","b0","set","showme","TriggerValue")
  57.     call notify("c1","selected","EveryTime","b1","set","showme","TriggerValue")
  58.     call notify("c2","selected","EveryTime","b2","set","showme","TriggerValue")
  59.     call notify("c3","selected","EveryTime","b3","set","showme","TriggerValue")
  60.     call notify("c4","selected","EveryTime","b4","set","showme","TriggerValue")
  61.  
  62.     call set("mwin","open",1)
  63.     call getattr("mwin","open","o")
  64.     if o=0 then do
  65.         say "can't open window"
  66.         exit
  67.     end
  68.  
  69.     return
  70. /***********************************************************************/
  71. HandleApp: procedure  expose global.
  72.     ctrl_c=2**12
  73.     do forever
  74.         call NewHandle("APP","H",ctrl_c)
  75.         if and(h.signals,ctrl_c)>0 then exit
  76.         select
  77.             when h.event="QUIT" then exit
  78.             otherwise nop
  79.         end
  80.     end
  81.     /* never reached */
  82. /***********************************************************************/
  83. err: procedure expose sigl RxMUIError
  84. parse arg res
  85.     msg = ProgramName()":" GetRxMUIString(res) "in line" sigl-1
  86.     if RxMUIError~="RXMUIERROR" then msg = msg "["RxMUIError"]"
  87.     say msg
  88.     exit
  89.  
  90. /***********************************************************************/
  91. halt:
  92. break_c:
  93.     exit
  94. /**************************************************************************/
  95.